//生成表格
form.testData = [];
if (form.highSideWinding) {
  historyWanted = {};
  for (i = form.gearsStartNumber; i < form.gearsEndNumber + 1; i++) {
    historyWanted.i = 3;
    ops = ['OA', 'OB', 'OC'];
    ops.forEach((v, index) => {
      form.testData.push({
        gearNumber: i,
        oabc: v,
        value75: '/',
        his75: NaN,
        diff1: '/',
        diff2: '/',
        // for show
        value75Show: '/',
        his75Show: '/',
        diff1Show: '/',
        diff2Show: '/',
      });
    });
  }
}
if (form.lowSideWinding) {
  i = '低压侧';
  historyWanted = {};
  historyWanted.i = 3;
  ops = ['AB', 'BC', 'CA'];
  ops.forEach((v, index) => {
    form.testData.push({
      gearNumber: i,
      oabc: v,
      value75: '/',
      his75: NaN,
      diff1: '/',
      diff2: '/',
    });
  });
}
// 加载历史数据
history = [];
for (task in refData.preTask) {
  for (item in task.testData) {
    if (historyWanted[item.gearNumber]) {
      history.push(item);
    }
    historyWanted[item.gearNumber]--;
    if (historyWanted[item.gearNumber] === 0) {
      delete historyWanted[item.gearNumber];
    }
    if (Object.keys(historyWanted).length === 0) {
      break;
    }
  }
}
// 回填表格
for (item in history) {
  fillingItem = form.testData.find(
    (e) =>
      e.gearNumber === item.gearNumber &&
      e.oabc.toLowerCase() === item.oabc.toLowerCase(),
  );
  if (fillingItem) {
    fillingItem.his75Show = item.value75;
    fillingItem.his75 = parseFloat(item.value75Show);
  }
}
